package team.knowers.qzhserver.user.userFollower.entity.dao;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import team.knowers.qzhserver.common.entity.BaseDO;

import java.io.Serial;
import java.util.Date;

@EqualsAndHashCode(callSuper = true)
@Data
@TableName(value = UserFollowerDOField.TABLE_NAME)
public class UserFollowerDO extends BaseDO {
    @Serial
    private static final long serialVersionUID = 1L;

    //此条关注记录的id
    @TableId(value = UserFollowerDOField.ID, type = IdType.ASSIGN_ID)
    private String id;

    //被关注用户的id
    @TableField(value = UserFollowerDOField.USER_ID)
    private String userId;

    //关注者的id
    @TableField(value = UserFollowerDOField.FOLLOWER_ID)
    private String followerId;

    //关注时间
    @TableField(value = UserFollowerDOField.GMT_CREATE)
    private Date gmtCreate;

    public UserFollowerDO(String followerId,String userId){
        this.followerId=followerId;
        this.userId=userId;
        gmtCreate=new Date();
    }
}
